/*
* INSANE - Interactive Structural Analysis Environment
*
* Copyright (C) 2003-2005
* Universidade Federal de Minas Gerais
* Escola de Engenharia
* Departamento de Engenharia de Estruturas
* 
* Author's email :    insane@dees.ufmg.br
* Author's website :  http://www.dees.ufmg.br/insane
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
package br.ufmg.dees.insane.model.femModel.element.force;

import java.util.ArrayList;
import java.util.ListIterator;

import br.ufmg.dees.insane.model.femModel.pointforce.PointForce;
import br.ufmg.dees.insane.util.LoadCase;


/**
 * A class representing a distributed force.<br> It may be a constant distributed force, a trapezoidal distributed force or a triangular distributed force.
 * @author  Fonseca, Flavio & Pitangueira, Roque
 * @version  1.0
 * @since  September 2003
 * @see PointForce
 * @see  java.util.ArrayList
 */

public class ElementForce implements java.io.Serializable {
	
	private static final long serialVersionUID = 1L;

	/** The label of this ElementForce. */
	protected String label;
	
	/** An ArrayList containing the multiple PointForces which form this ElementForce. */
	protected ArrayList<PointForce> pointForces = new ArrayList<PointForce>();
	
//********************************************************************************
	
	/**
	 * Returns the label of this ElementForce.
	 * @return  The label of this ElementForce.
	 * @uml.property  name="label"
	 */
	public String getLabel(){
		return (label);
	};
	
	/**
	 * Sets the label of this ElementForce.
	 * @param a  The label of this ElementForce.
	 * @uml.property  name="label"
	 */
	public void setLabel(String a){
		label = a;
	};
	
//********************************************************************************
	
	/** Returns the number of forces of this ElementForce.
	*@return The number of forces of this ElementForce.
	*/
	public int getNumberOfForces(){
		return (pointForces.size());
	};
	
//********************************************************************************
	
	/** Returns the list of PointForces of this ElementForce.
	*@return The list of PointForces of this ElementForce.
	*/
	public ArrayList getPointForcesList() {
		return (pointForces);
	};
	
//********************************************************************************
	
	/** Adds a PointForce to this ElementForce.
	*@param a The PointForce to be added.
	*/
	public void add(PointForce a) {
		pointForces.add(a);
	}

//********************************************************************************
	
	/** Sets the LoadCase of this ElementForce.
	*@param a The desired loadCase.
	*/
	public void setLoadCase(LoadCase lc){
		ListIterator pfs = pointForces.listIterator();
		while (pfs.hasNext()) {
			PointForce pf = (PointForce)pfs.next();
			pf.setLoadCase(lc);
		}
	}
	
//********************************************************************************
}
